function send_ajax(send_url, callback) {
	$.ajax({
		url : send_url,
		success : callback,
		error : function() {
			alert("请求失败");
		}
	});
}
function value_get(data) {
	// alert(data.getElementsByTagName("temperature")[0].childNodes[0].nodeValue);
	if (data == "OK") {
	} else if (data == "FALSE") {
		alert("false");
	}
}
function send_State(senorName, Action) {

	send_ajax("/postCommand?senorname=" + senorName + "&action=" + Action
			+ "&" + getRandom(10), value_get);
}

function post_Action(senorName, Action) {
	send_ajax("/pushMsg?senorname=" + senorName + "&action=" + Action
			+ "&" + getRandom(10), value_get);
}

function getRandom(n){
	var rnd="";
	for(var i=0;i<n;i++)
	rnd+=Math.floor(Math.random()*10);
	return rnd;
}